package net.sxnic.item.mdata.action;


@SuppressWarnings("serial")
public class View extends MdataAction{
	
	public String execute() throws Exception{
		treatYCC();
		//获取主表数据
		mdata = mdManager.get(id);		
		//获取子表数据
		itemFund = fundManager.getEntityByBaseinfoId(id);
		itemPrincipal = principalManager.getEntityByBaseinfoId(id);
		itemClob = clobManager.getEntityByBaseinfoId(id);
		peopleList = peopleManager.findListByBaseinfoId(id);
		ssmbList = ssmbManager.findListByBaseinfoId(id);
		annex001List = annexManager.findListByFileSort("001",id);
		annex002List = annexManager.findListByFileSort("002",id);
		if("009".equals(mdata.getSoperCode()))
		{
			gwGjhzunitList = gjhzunitManager.findGwGjhzunit(id);
			if(gwGjhzunitList!=null&&gwGjhzunitList.size()>0)
			{
				gwCountry1 = gwGjhzunitList.get(0).getCoCountry();
				gwOrgname1 = gwGjhzunitList.get(0).getCoOrgname();
				gwLeader1 = gwGjhzunitList.get(0).getCoLeader();
				gwPhone1 = gwGjhzunitList.get(0).getCoPhone();
				gwFax1 = gwGjhzunitList.get(0).getCoFax();
				gwEmail1 = gwGjhzunitList.get(0).getCoEmail();
				gwCountry2 = gwGjhzunitList.get(1).getCoCountry();
				gwOrgname2 = gwGjhzunitList.get(1).getCoOrgname();
				gwLeader2 = gwGjhzunitList.get(1).getCoLeader();
				gwPhone2 = gwGjhzunitList.get(1).getCoPhone();
				gwFax2 = gwGjhzunitList.get(1).getCoFax();
				gwEmail2 = gwGjhzunitList.get(1).getCoEmail();
			}
			gnGjhzunitList = gjhzunitManager.findGnGjhzunit(id);
			if(gnGjhzunitList!=null&&gnGjhzunitList.size()>0)
			{

				gnOrgname1 = gnGjhzunitList.get(0).getCoOrgname();
				gnLeader1 = gnGjhzunitList.get(0).getCoLeader();
				gnPhone1 = gnGjhzunitList.get(0).getCoPhone();
				gnFax1 = gnGjhzunitList.get(0).getCoFax();
				gnEmail1 = gnGjhzunitList.get(0).getCoEmail();
				gnOrgname2 = gnGjhzunitList.get(1).getCoOrgname();
				gnLeader2 = gnGjhzunitList.get(1).getCoLeader();
				gnPhone2 = gnGjhzunitList.get(1).getCoPhone();
				gnFax2 = gnGjhzunitList.get(1).getCoFax();
				gnEmail2 = gnGjhzunitList.get(1).getCoEmail();
			}
		}
		
		if(pageNo == null || pageNo ==0){
			pageNo = 1;
		}
		
		//JSP对应的页面年份
		jspYear= dyManager.findJspYear(mdata.getAppYear(), mdata.getCatalog1(), mdata.getCatalog2());
		jspCatalog = operationManager.findJspCatalog(mdata.getCatalog1(), mdata.getCatalog2(), mdata.getSoperCode());
		return SUCCESS;
	}

}
